clang-tidy replaces C standard library headers with their C++ alternatives.
authortsteven4 <tsteven4@gmail.com>
Fri, 1 Jun 2018 15:34:30 +0000 (09:34 -0600)
committertsteven4 <tsteven4@gmail.com>
Fri, 1 Jun 2018 15:34:30 +0000 (09:34 -0600)
-header-filter=.*\\.h -checks=-*,modernize-deprecated-headers -fix

19 files changed:
cet.h
compegps.cc
defs.h
garmin_device_xml.h
garmin_txt.cc
gbser.h
gbsleep.cc
height.h
jeeps/garminusb.h
jeeps/gps.h
jeeps/gpscom.h
jeeps/gpsfmt.h
navilink.h
src/core/datetime.h
src/core/file.h
src/core/logging.h
stmsdf.cc
stmwpp.cc
transform.cc

diff --git a/cet.h b/cet.h
index cd4fe108f11496df6c5f00124072c14d962a6724..d1333211c3a3770ff29cb34f95e09d82ea592511 100644 (file)
--- a/cet.h
+++ b/cet.h
@@ -22,7 +22,7 @@
 #ifndef CET_H
 #define CET_H
 
-#include <stddef.h> // for size_t
+#include <cstddef> // for size_t
 
 #define CET_ERROR      1
 #define CET_SUCCESS    0
index ff7104dc0fd05779e8caf3b50b5501ea38299f7c..e8919a6ef5bd8043998618b6452117c4c56ff401 100644 (file)
 #include "csv_util.h"
 
 #if CSVFMTS_ENABLED
-#include <math.h>
+#include <cmath>
 #include "jeeps/gpsmath.h"
-#include <stdlib.h>
-#include <stdio.h>
+#include <cstdlib>
+#include <cstdio>
 
 #define MYNAME "CompeGPS"
 
diff --git a/defs.h b/defs.h
index 98e025f1656c9983edf8e3845ed1369760167363..dc9b77efcd303267a4bc42ef79caca1d788272f0 100644 (file)
--- a/defs.h
+++ b/defs.h
@@ -19,7 +19,7 @@
 #ifndef DEFS_H_INCLUDED_
 #define DEFS_H_INCLUDED_
 
-#include <stdint.h>
+#include <cstdint>
 
 #if HAVE_CONFIG_H
 #include "config.h"
index 067d44a767388d57b713ae8e25257140c1802546..924bb3e0f5ef29fd65b364cb96ffa4deffdeaa3b 100644 (file)
@@ -51,6 +51,6 @@ const gdx_info* gdx_find_file(char** dirlist);
 // that can't back out tracefully without bludgeoning most of the
 // (Mac|Lin|Win) x (USB|Serial) matrix.   Since we don't *really* want
 // to progress any further, we just longjump back to the caller...
-#include <setjmp.h>
+#include <csetjmp>
 extern jmp_buf gdx_jmp_buf;
 
index 6abe3b5665afb3d324dec6bbf0381276a09af671..38270128f5b4d161008591c845347da221b45f67 100644 (file)
@@ -33,7 +33,7 @@
 #include "strptime.h"
 
 #include <cmath>
-#include <stdlib.h> // qsort
+#include <cstdlib> // qsort
 
 #define MYNAME "garmin_txt"
 
diff --git a/gbser.h b/gbser.h
index 661d2c5052f498104dd30cfd145cf1cf038454c0..697c2ca3e32c068038f2e2dca23d0aa71af84631 100644 (file)
--- a/gbser.h
+++ b/gbser.h
@@ -22,7 +22,7 @@
 #ifndef __GBSER_H
 #define __GBSER_H
 
-#include <stddef.h> // for size_t
+#include <cstddef> // for size_t
 
 #define gbser_OK         0
 #define gbser_NOTHING   -1
index cc72a142db812c5cc1d77f394b9252bb82cf7b20..25da77f2ddbc26da289d01d96fd9aa279d43628b 100644 (file)
@@ -33,7 +33,7 @@ gb_sleep(unsigned long microseconds)
 
 #elif defined HAVE_NANOSLEEP
 
-#include <time.h>
+#include <ctime>
 void
 gb_sleep(unsigned long microseconds)
 {
index fd8f397dce24f3ad623fffa3d6a26068fd3e2997..56fe5b4b1f4202c671eeac3e075b7c594528e0a5 100644 (file)
--- a/height.h
+++ b/height.h
@@ -21,7 +21,7 @@
 
 /* Created by "tools/createGeoidGrid 1.0 int8_t" using GeographicLib utility GeoidEval with egm96-5. */
 
-#include <stdint.h>
+#include <cstdint>
 
 #define GEOID_GRID_DEG 1.0
 #define GEOID_SCALE 1.0
index 476e70febef1528cb0a8a641dec0b7186fc88e95..a090d0af799732e0847b8476d9caf6113bd7dc00 100644 (file)
@@ -18,7 +18,7 @@
     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
 
  */
-#include <stdio.h>
+#include <cstdio>
 #include "gpsdevice.h"
 
 /* This structure is a bit funny looking to avoid variable length
index 7ef2d3e5e08bed49dc5dcb8acc930b775e07a5b4..b897f89d7498ca4c580d933196cb7584bd923ce3 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "../defs.h"
 #include "gpsport.h"
-#include <time.h>
+#include <ctime>
 
 #define FRAMING_ERROR  -1
 #define PROTOCOL_ERROR -2
index 1c8c5f3cb8a8561e74ff3450c598f50363ad283e..7bbd6a66d92f5f325c8a1f4268dc1665a7dd75d0 100644 (file)
@@ -3,7 +3,7 @@
 
 
 #include "gps.h"
-#include <time.h>
+#include <ctime>
 
   int32  GPS_Command_Off(const char* port);
 
index 3f1ce4c9f76be73e597758ab9c154bca21607a92..454cc77fd532b3cadc93452d58dab05631cb9ba4 100644 (file)
@@ -3,8 +3,8 @@
 
 
 #include "gps.h"
-#include <stdio.h>
-#include <time.h>
+#include <cstdio>
+#include <ctime>
 
   void   GPS_Fmt_Print_Time(time_t Time, FILE* outf);
   void   GPS_Fmt_Print_Position(double lat, double lon, FILE* outf);
index 9f0cc51245eed79698016393ac3b5968cd8840e7..99a89e86e5fabc73d6fc1f42b5039d0bc2c94c4d 100644 (file)
@@ -23,7 +23,7 @@
 #ifndef NAVILINK_H_INCLUDED_
 #define NAVILINK_H_INCLUDED_
 
-#include <time.h>
+#include <ctime>
 #include "defs.h"
 
 #define SBP_RECORD_LEN 32
index 18a3eaae9aad50355058015febdc8d5b81796b56..15065f1d11659dbe03b9ce29924cd0f17ab22685 100644 (file)
@@ -21,7 +21,7 @@
  */
 
 
-#include <time.h>
+#include <ctime>
 
 #include <QtCore/QtGlobal>
 #include <QtCore/QDateTime>
index 1e1fd3880303e73e30d58a61cb8f81ed472b338f..198cc33c83234ff2d21ef194ab1edb5e507fd473 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <QtCore/QFile>
 #include <QtCore/QIODevice>
-#include <stdio.h>
+#include <cstdio>
 #include "defs.h"
 
 // Mimic gbfile open services
index f5d257db32de36ca3dd963109714c2ea7e7d9723..af0a7ed0c8f615ec04f08a836594f5fa10da49ea 100644 (file)
@@ -24,7 +24,7 @@
 
 #include <QtCore/QTextStream>
 #include <QtCore/QFile>
-#include <stdlib.h> //exit()
+#include <cstdlib> //exit()
 
 class Warning {
  public:
index eca3ca2a80b689712a7806f56cc2468aefa35e8a..7dd66f32682f1263121273d110c40310e84ed9cc 100644 (file)
--- a/stmsdf.cc
+++ b/stmsdf.cc
@@ -36,9 +36,9 @@
 #include "jeeps/gpsmath.h"
 #include "grtcirc.h"
 
-#include <time.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <ctime>
+#include <cstdio>
+#include <cstdlib>
 
 #define MYNAME "stmsdf"
 
index 55a5880248cb71b72afc195d3c6114cacadd3541..52be78c2a4084b2339ce8f122c2a4a83b4fad853 100644 (file)
--- a/stmwpp.cc
+++ b/stmwpp.cc
@@ -27,9 +27,9 @@
 
 #include "csv_util.h"
 #include "cet_util.h"
-#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
+#include <cctype>
+#include <cstdio>
+#include <cstdlib>
 
 static gbfile* fin, *fout;
 static route_head* track, *route;
index 21c0a0d876fab931754073712f29d839f3c04966..08ce43a296ba77e9188eb27008c1ef1897eac25e 100644 (file)
@@ -26,7 +26,7 @@
 
 #if FILTERS_ENABLED
 
-#include <ctype.h>
+#include <cctype>
 
 #define MYNAME "transform"